public with sharing class CommonAttribute {
    public String RegionSelectedValue{get;set;}//选中的区域值
    public String SubRegionSelectedValue{get;set;}//选中片区的值
    public String AreaSelectedValue{get;set;}//区域选择的值
    public String CitySelectedValue{get;set;}//城市选择的值
    public String OutletTypeSelectedValue{get;set;}//门店类型选择的值 
    public String ChannelSelectedValue{get;set;}//渠道选择的值  
    public String KASelectedValue{get;set;}
    public String ASMSelectedValue{get;set;}
    public String CostSourceSelectedValue{get;set;}//竞品费用来源选择的值
    public String SSYKACostTypeSelectedValue{get;set;}//SSY活动KA竞品费用类型选择的值
    public String SSYOTCostTypeSelectedValue{get;set;}//SSY活动OT竞品费用类型选择的值
    public String KACostTypeSelectedValue{get;set;}//KA活动竞品费用类型选择的值
     public String RegionCostTypeSelectedValue{get;set;}//Region活动竞品费用类型选择的值
    
    public String SSYPromotionTypeSelectedValue{get;set;}//SSY竞品促销形式选择的值
    public String KAPromotionTypeSelectedValue{get;set;}//KA竞品促销形式选择的值
    public String RegionPromotionTypeSelectedValue{get;set;}//Region竞品促销形式选择的值
    
    public CommonAttribute()
    {
     //  RegionSelectedValue='华东区';
      // SubRegionSelectedValue='华东一区';
       //AreaSelectedValue='上海区域';
    }
    
   //大区
   public List<SelectOption> RegionList
    {
        get
        {
              List<SelectOption> RegionListValue=new List<SelectOption>();     
              RegionListValue.add( new SelectOption('0','所有大区'));           
              for(Place__c p:[select Id,Name from Place__c where PlaceType__c='Region' order by name])
              {
                RegionListValue.add(new SelectOption(p.Name,P.Name));
              }                              
              return RegionListValue;
        }    
        set;
    }
     //SRTM或RTM对应的大区
   public List<SelectOption> SRTMRegionList
    {
        get
        {
        User user=[select Title_Functional__c,UserRegion__c from User where id=:UserInfo.getUserId()];
        List<SelectOption> TheRegionList=new List<SelectOption>();   
        TheRegionList.add( new SelectOption('0','所有大区'));         
        if(user.UserRegion__c!=NULL)
           TheRegionList.add(new SelectOption(user.UserRegion__c,user.UserRegion__c));                              
        return TheRegionList;
        }    
        set;
    }
    //片区
    public List<SelectOption> SubRegionList
    {
        get
        {
            if(RegionSelectedValue==NULL)
                RegionSelectedValue=RegionList[0].getValue();
            List<SelectOption> SubRegionListValue=new List<SelectOption>();
            SubRegionListValue.add( new SelectOption('0','所有片区'));
            for(Place__c p:[select Id,Name from Place__c where PlaceType__c='Sub-region' and Region__r.Name=:RegionSelectedValue order by name])
            {
               SubRegionListValue.add(new SelectOption(p.Name,P.Name));
            } 
            return SubRegionListValue;
        }
        set;
    }
    //区域
    public List<SelectOption> AreaList
    {
        get
        {
            if(SubRegionSelectedValue==NULL)
                SubRegionSelectedValue=SubRegionList[0].getValue();
            List<SelectOption> AreaListValue=new List<SelectOption>();
            AreaListValue.add(new SelectOption('0','所有区域'));
            for(Place__c p:[select Id,Name from Place__c where PlaceType__c='Area' and Subregion__r.Name=:SubRegionSelectedValue order by name])
            {
                AreaListValue.add(new SelectOption(p.Name,P.Name));
            }
            return AreaListValue;
        }
        set;
    }
    //城市
    public List<SelectOption> CityList
    {
        get
        {
            List<SelectOption> CityListValue=new List<SelectOption>();
            CityListValue.add(new SelectOption('0','所有城市'));
            for(Place__c p:[select Id,Name from Place__c where PlaceType__c='City' and Area__r.Name=:AreaSelectedValue order by name])
            {
                CityListValue.add(new SelectOption(P.Name,P.Name));
            }
            return CityListValue;
        }
        set;
    }
    public List<SelectOption> AllCityList
    {
        get
        {
            List<SelectOption> CityListValue=new List<SelectOption>();
            User u=[select UserCity__c from user where id=:UserInfo.getUserId()];
           if(u.UserCity__c!=NULL)
           {
                string[] cityList=String.valueOf(u.UserCity__c).split(';');
                for(String str:cityList)
                {
                        CityListValue.add(new SelectOption(str,str));
                }
           }
            return CityListValue;
        }
        set;
    }
    //渠道
    public List<SelectOption> OutletChannelList
    {
        get
        {
            List<SelectOption> channelList=new List<SelectOption>();
            Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields.Channel__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
            channelList.add(new SelectOption('','ALL'));
            for(Schema.PicklistEntry entry : P)
            {
               channelList.add(new SelectOption(entry.getValue(),entry.getLabel()));//getValue()
            }
            return channelList;
        }
    }
    //门店类型
    public List<SelectOption> OutletTypeList
    {
        get
        {
            List<SelectOption> outletList=new List<SelectOption>();
          //  Schema.DescribeFieldResult f2 = Schema.sObjectType.Account.fields.Outlet_Type__c;
         //   List<Schema.PicklistEntry> P2 = F2.getPicklistValues();
            outletList.add(new SelectOption('','ALL'));
       //     for(Schema.PicklistEntry entry : P2)
      //      {
               outletList.add(new SelectOption('全国重点客户','全国重点客户'));
               outletList.add(new SelectOption('区域重点客户','区域重点客户'));
               outletList.add(new SelectOption('婴儿用品店','婴儿用品店'));
               outletList.add(new SelectOption('目录直送店','目录直送店'));
               outletList.add(new SelectOption('其他','其他'));
     //       }
            return outletList;
        }
    }
    //KA
      public List<SelectOption> OutletKAList
    {
        get
        {
            List<SelectOption> KAList=new List<SelectOption>();
            Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields.Chain_Customer__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
        //    KAList.add(new SelectOption('','ALL'));
            for(Schema.PicklistEntry entry : P)
            {
               if(entry.getLabel()!='经销商')
                   KAList.add(new SelectOption(entry.getValue(),entry.getLabel()));//getValue()
            }
            return KAList;
        }
    }
    //KA列表值，包括ＡＬＬ
      public List<SelectOption> OutletALLKAList
    {
        get
        {
            List<SelectOption> KAList=new List<SelectOption>();
            Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields.Chain_Customer__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
            KAList.add(new SelectOption('','ALL'));
            for(Schema.PicklistEntry entry : P)
            {
               KAList.add(new SelectOption(entry.getValue(),entry.getLabel()));//getValue()
            }
            return KAList;
        }
    }
// SSY活动竞品促销形式
    public List<SelectOption> SSYCompetitionPromotionType
    {
        get
        {
             List<SelectOption> PromotionTypeList=new List<SelectOption>();
            PromotionTypeList.add(new SelectOption('','ALL'));
             Schema.DescribeFieldResult f = Schema.sObjectType.Outlet_Comptition_Brand_Information__c.fields.SSY_Promotion_Type__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
            for(Schema.PicklistEntry entry : P)
            {
               PromotionTypeList.add(new SelectOption(entry.getValue(),entry.getLabel()));//getValue()
            }
            return PromotionTypeList;
        }
    }
    //KA活动竞品促销形式
    public List<SelectOption> KACompetitionPromotionType
    {
        get
        {
             List<SelectOption> PromotionTypeList=new List<SelectOption>();
            PromotionTypeList.add(new SelectOption('','ALL'));
             Schema.DescribeFieldResult f = Schema.sObjectType.Outlet_Comptition_Brand_Information__c.fields.KA_Promotion_Type__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
            for(Schema.PicklistEntry entry : P)
            {
               PromotionTypeList.add(new SelectOption(entry.getValue(),entry.getLabel()));//getValue()
            }
            return PromotionTypeList;
        }
    }
    
    //Region活动竞品促销形式
    public List<SelectOption> RegionCompetitionPromotionType
    {
        get
        {
             List<SelectOption> PromotionTypeList=new List<SelectOption>();
            PromotionTypeList.add(new SelectOption('','ALL'));
             Schema.DescribeFieldResult f = Schema.sObjectType.Outlet_Comptition_Brand_Information__c.fields.Region_Promotion_Type__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
            for(Schema.PicklistEntry entry : P)
            {
               PromotionTypeList.add(new SelectOption(entry.getValue(),entry.getLabel()));//getValue()
            }
            return PromotionTypeList;
        }
    }
     //SSY活动KA竞品费用类型
    public List<SelectOption> SSYKACompetitionCostType
    {
          get
        {
             List<SelectOption> CostTypeList=new List<SelectOption>();
            CostTypeList.add(new SelectOption('','ALL'));
             Schema.DescribeFieldResult f = Schema.sObjectType.Outlet_Comptition_Brand_Information__c.fields.SSY_KA_Cost_Type__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
           for(Schema.PicklistEntry entry : P)
            {
                CostTypeList.add(new SelectOption(entry.getValue(),entry.getLabel()));
            }
            return CostTypeList;
        }
    }
    
     //SSY活动OT竞品费用类型
    public List<SelectOption> SSYOTCompetitionCostType
    {
          get
        {
             List<SelectOption> CostTypeList=new List<SelectOption>();
            CostTypeList.add(new SelectOption('','ALL'));
             Schema.DescribeFieldResult f = Schema.sObjectType.Outlet_Comptition_Brand_Information__c.fields.SSY_OT_Cost_Type__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
           for(Schema.PicklistEntry entry : P)
            {
                CostTypeList.add(new SelectOption(entry.getValue(),entry.getLabel()));
            }
            return CostTypeList;
        }
    }
    //KA活动竞品费用类型
    public List<SelectOption> KACompetitionCostType
    {
          get
        {
             List<SelectOption> CostTypeList=new List<SelectOption>();
            CostTypeList.add(new SelectOption('','ALL'));
             Schema.DescribeFieldResult f = Schema.sObjectType.Outlet_Comptition_Brand_Information__c.fields.KA_Cost_Type__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
           for(Schema.PicklistEntry entry : P)
            {
                CostTypeList.add(new SelectOption(entry.getValue(),entry.getLabel()));
            }
            return CostTypeList;
        }
    }
     //Region活动竞品费用类型
    public List<SelectOption> RegionCompetitionCostType
    {
          get
        {
             List<SelectOption> CostTypeList=new List<SelectOption>();
            CostTypeList.add(new SelectOption('','ALL'));
             Schema.DescribeFieldResult f = Schema.sObjectType.Outlet_Comptition_Brand_Information__c.fields.Region_Cost_Type__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
           for(Schema.PicklistEntry entry : P)
            {
                CostTypeList.add(new SelectOption(entry.getValue(),entry.getLabel()));
            }
            return CostTypeList;
        }
    }
    //竞品费用来源
    public List<SelectOption> CompetitionCostSource
    {
        get
        {
             List<SelectOption> CostSourceList=new List<SelectOption>();
            CostSourceList.add(new SelectOption('','ALL'));
             Schema.DescribeFieldResult f = Schema.sObjectType.Outlet_Comptition_Brand_Information__c.fields.Competition_Cost_Source__c;
            List<Schema.PicklistEntry> P = F.getPicklistValues();
           for(Schema.PicklistEntry entry : P)
            {
                CostSourceList.add(new SelectOption(entry.getValue(),entry.getLabel()));
            }
            return CostSourceList;
        }
    }
    
    //ActivityInformation的Activity_Stage__c值
 public List<String> ActivityStageList{
 get{
    List<String> activityStageList=new List<String>();
    activityStageList.add('总部己发起活动');
    activityStageList.add('KAM己提交');
    activityStageList.add('总部己确认KAM的调整');
    activityStageList.add('草稿');
    return activityStageList;
       }
   }
}